//
//  SLTransitionChildController.m
//  Objective-C
//
//  Created by S_Line on 2018/7/6.
//  Copyright © 2018年 S_Line. All rights reserved.
//

#import "SLTransitionChildController.h"

@interface SLTransitionChildController ()

@property (nonatomic, weak) UILabel *privateTitleLabel;

@end

@implementation SLTransitionChildController

- (void)initNavBar {
    
}

- (void)setTitle:(NSString *)title {
    super.title = title;
    [self updateAppearance];
}

- (void)setThemeColor:(UIColor *)themeColor {
    _themeColor = themeColor;
    [self updateAppearance];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self initNavBar];
    
    [self initView];
    
    [self updateAppearance];
}

- (void)initView {
    UILabel *titleLabel = [[UILabel alloc] init];
    self.privateTitleLabel = titleLabel;
    titleLabel.font = [UIFont systemFont15];
    [self.view addSubview:titleLabel];
    [titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX).mas_offset(0);
        make.centerY.equalTo(self.view.mas_centerY).mas_offset(0);
    }];
}

- (void)updateAppearance {
    if ([self isViewLoaded]) {
        self.privateTitleLabel.text = self.title;
        self.view.backgroundColor = self.themeColor;
        self.view.tintColor = self.themeColor;
    }
}

@end
